﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

//命名空间 根据项目名.文件夹路径
namespace CDH_Shop.Models.Good
{
    /// <summary>
    /// 添加商品请求类
    /// </summary>
    public class AddGoodRequest
    {
        /// <summary>
        /// 商品名称
        /// </summary>
        [StringLength(maximumLength: 100, MinimumLength = 5, ErrorMessage = "请输入5-100位商品名称")]
        [Required(ErrorMessage = "请输入商品名称")]
        public string GoodName { get; set; }
        /// <summary>
        /// 商品封面图
        /// </summary>
        [Required(ErrorMessage = "请输入封面图")]
        public string GoodCover { get; set; }
        /// <summary>
        /// 商品价格
        /// </summary>
        [Required(ErrorMessage = "请输入价格")]
        [Range(0, 99999999, ErrorMessage = "请输入0-99999999价格")]
        public decimal Price { get; set; }
        /// <summary>
        /// 商品库存
        /// </summary>
        [Required(ErrorMessage = "请输入库存")]
        [Range(0, 99999999, ErrorMessage = "请输入0-99999999")]
        public int Stock { get; set; }
        /// <summary>
        /// 商品描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 商品分类Id 
        /// </summary> 
        public int CateId { get; set; }
        /// <summary>
        /// 商品状态（定义1上架  0下架）
        /// </summary>
        public int State { get; set; }
    }
}
